﻿using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace SimpleWebApp.Demo02
{
    public sealed class StringContentMiddleware : IMiddleware
    {
        private readonly string _contents;

        public StringContentMiddleware(string contents)
            => _contents = contents;


        public Task InvokeAsync(HttpContext context, RequestDelegate next)
            => context.Response.WriteAsync(_contents);

    }
}
